import { stringify } from 'qs';
import request from '@/utils/request';

export async function queryToken() {
  return request('/project/login/tokenUpdate');
}

export async function queryCurrent(body) {
  // '/api/currentUser'
  return request('/project/staff/staffInfoByToken', {
    method: 'POST',
    body
  });
}

export async function queryUsers() {
  return request('/api/users');
}

export async function queryDepartment() {
  return request('/project/Department/departmentList');
}

export async function queryStaff(body) {
  return request('/project/Staff/staffListByDepartmentId', {
    method: 'POST',
    body
  });
}

export async function changeCurrent(body) {
  return request('/project/staff/staffInfoByToken', {
    method: 'POST',
    body
  });
}

export async function changePassword(params) {
  return request('/project/staff/changePasswordByToken', {
    method: 'POST',
    body: {
      ...params,
      method: 'post',
    },
  });
}